package com.yyge.controller.admin.mapstruct;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yyge.common.vo.resp.PageResp;
import com.yyge.controller.admin.merchandiser.req.MerchandiserReq;
import com.yyge.controller.admin.merchandiser.req.ProcessReq;
import com.yyge.controller.admin.merchandiser.resp.MerchandiserResp;
import com.yyge.controller.front.merchandiser.req.MerchandiserAddReq;
import com.yyge.entity.Merchandiser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface MerchandiserConverter {
    MerchandiserConverter MAPPER = Mappers.getMapper(MerchandiserConverter.class);

     @Mapping(source="records",target="rows")
     PageResp<MerchandiserReq> convert(Page list);

     Merchandiser convert(MerchandiserReq req);
     Merchandiser convert(ProcessReq req);
     Merchandiser convert(MerchandiserAddReq req);
     List<MerchandiserResp> convert(List<Merchandiser> list);

     PageResp<MerchandiserResp> convert(PageResp<Merchandiser> page);
}
